import { Component, OnInit } from '@angular/core';
import * as swiper from 'swiper';

@Component({
  selector: 'app-sjfsc',
  templateUrl: './sjfsc.component.html',
  styleUrls: ['./sjfsc.component.css']
})
export class SjfscComponent implements OnInit {
  plc = [
    {
      simg: '../../assets/jf1.jpg',
      sgoods: '优质核桃夹子',
      name: '优质核桃夹子',
      sprice: '积分: 1 价值: ¥20'
    },
    {
      simg: '../../assets/jf2.jpg',
      sgoods: '沙湖辣子酱',
      name: '沙湖辣子酱',
      sprice: '积分: 1 价值: ¥20'
    },
    {
      simg: '../../assets/jf3.png',
      sgoods: '沙湖辣子酱',
      name: '沙湖辣子酱',
      sprice: '积分: 1 价值: ¥20'
    },
    {
      simg: '../../assets/jf4.jpg',
      sgoods: '沙湖辣子酱',
      name: '沙湖辣子酱',
      sprice: '积分: 1 价值: ¥20'
    }
  ]
  constructor() { }

  ngOnInit() {
    const mySwiper = new swiper['default']('.swiper-container', {
      loop: true,

      // 如果需要分页器
      pagination: {
        el: '.swiper-pagination',
      },

      // 如果需要前进后退按钮
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
      autoplay: {
        delay: 2000,
        stopOnLastSlide: false,
        disableOnInteraction: false,
      }
    });
  }

}
